#include "stdafx.h"
#include "home.h"
#include "mine.h"
#include "saloon.h"
#include "location.h"
#include "character.h"
#include <iostream>
using namespace std;

Home* Home::Instance()
{
	static Home instance;
	return (&instance);
}

void Home::Enter(AICHARACTER *pMiner)
{
	if(pMiner->getLocation() != home){
		cout << pMiner->getName() << " : " << "Go home..." << endl;
		pMiner->changeLocation(home);
	}
}
void Home::Execute(AICHARACTER *pMiner)
{
	if(!pMiner->isFatigue()){
		cout << pMiner->getName() << " : Good job, Now go to work to mine..." << endl;
		pMiner->changeState(Mine::Instance());
	}
	else{
		pMiner->decreaseFatigue();
		cout << pMiner->getName() << " : ZZZZ... " << endl;
	}
}


void Home::Exit(AICHARACTER *pMiner)
{
	cout << pMiner->getName() << " : " << "Exit from home..." << endl;
}



